import request from '@/router/axios';

export const getTraceabilityRecord = (params) => {
  return request({
    url: '/api/mes-product/productiontrace/list',
    method: 'get',
    params: params
  });
};

export const getLotNoList = (params) => {
  return request({
    url: '/api/mes-warehouse/receiving/lot-no-list',
    method: 'get',
    params: params
  });
};

// 追溯记录列表接口（正向）
export const getForwardObjectList = (params) => {
  return request({
    url: '/api/mes-product/productiontrace/object-list',
    method: 'get',
    params: {
      ...params,
      traceType: 'FORWARD'
    }
  });
};

// 采集信息报表接口
export const getMachineTestData = (params) => {
  return request({
    url: '/api/mes-product/machine-test-data/machine-test-date/info',
    method: 'get',
    params: params
  });
};

//获取子件组装数据
export const getParentOrSonData = (params) => {
  return request({
    url: '/api/mes-product/product/component/getAssembleSns',
    method: 'get',
    params: params
  });
};

// 载具搜索
export const carriersnList = (params) => {
  return request({
    url: '/api/mes-product/product/get-product-by-carrier-sn',
    method: 'get',
    params: params
  });
};

export const getRepiarDetail = (params) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/repair/detail',
    method: 'get',
    params
  });
};

// 外部序列号 转换成 内部序列号
export const getSnByOuterSn = (sequenceNumber) => {
  return request({
    url: '/api/mes-product/product/get-sequence-number-by-outer-sn?sequenceNumber=' + sequenceNumber,
    method: 'get'
  });
};

export const getPartInfo = (params) => {
  return request({
    url: '/api/mes-abacus/production-trace/reverse-trace-material-info',
    method: 'get',
    params: params
  });
};

export const getworkOrderUseInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-reverse-work-order-usage',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getInspectionInfo = (params) => {
  return request({
    url: '/api/mes-abacus/production-trace/reverse-inspection-info',
    method: 'get',
    params
  });
};

export const getParamKey = (params) => {
  return request({
    url: '/api/blade-system/param/detail',
    method: 'get',
    params
  });
};

export const getProductionPickingInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query/reverse-trace-production-picking-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getSmtFeedingInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query/reverse-trace-smt-feeding-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
